<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<div>
    <h1>The Ajax 04 Page</h1>
    <button onclick="doAjaxGet()">Do Ajax Get</button>
    <button onclick="doAjaxPost()">Do Ajax Post</button>
</div>
<span id="result"></span>
<script src="./ajaxlib.js"></script>
<script type="text/javascript">

    function doAjaxGet(){
        const url="http://localhost:8080/doAjaxGet/beijing";
        const params="";
        axios.ajaxGet(url,params,(result)=>{
            document.querySelector("#result").innerHTML=result;
        })
    }

    function doAjaxPost(){
        const url="http://localhost:8080/doAjaxPost";
        const params="id=102&city=shenzhen";
        axios.ajaxPost(url,params,function(result){
            alert(result);
        })
    }

</script>
</body>
</html>